home *** CD-ROM | disk | FTP | other *** search
- Subject: Re:ODF R1 RefCounting Extensio
- Sent: 6/1/96 8:34 AM
- Received: 6/3/96 7:58 AM
- From: Greg Friedman, friedman@cognosis.com
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- At 4:32 PM 5/30/96, Kirk Swenson wrote:> In ODF R1, calling
- FW_CExtensionManager::AcquireExtension() for our extension
- > never Acquire()'s the extension if it has to create it, so the refcount
- > remains 0, and a subsequent Release() leads to a warning from OpenDoc.
-
- Correctly initialized extensions begin life with a reference count of 1.
- Every extension should have a uniquely named "Init" method. When you create
- your extension, you should call the extension's Init method. Your custom
- Init method should, in addition to performing any specific initializations,
- call the Init method of your direct base. If you are directly subclassing
- ODExtension, you should call ODExtension::Init.
-
- ODExtension derives from ODRefCntObject. ODExtension::Init calls
- ODRefCntObject::Init, which sets the reference count of the extension to 1.
-
- You should also be sure to override Release in your custom extension and
- implement the following logic:
-
- FW_Boolean isValid = somSelf->IsValid(ev);
- FW_OSemanticInterface_parent_ODSemanticInterface_Release(somSelf,ev);
-
- if (!isValid && somSelf->GetRefCount(ev) == 0)
- delete somSelf;
-
- This code handles the case where the extension's reference count is
- dropping to zero, and the base has been removed.
-
- gsf.
-
-
-
-
- _________________________________________________________
- Greg Friedman ODF Engineering Apple Computer
-
-